//
//  RHUserGroupDateSettingCell.m
//  RuiHeApp
//
//  Created by Yan Chen on 2024/11/22.
//

#import "RHUserGroupDateSettingCell.h"
@interface RHUserGroupDateSettingCell()

@property (nonatomic, strong) QMUIButton *setBtn;
@end
@implementation RHUserGroupDateSettingCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}


-(void)setupUI
{
    kWeakSelf;
    self.contentView.backgroundColor = kCOLOR_HEX(@"#F0F5FF");
    UIView *bgView = [[UIView alloc]init];
    bgView.backgroundColor = UIColor.whiteColor;
    [self.contentView addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsMake(0, 15, 0, 15));
    }];
    
    _setBtn = [[QMUIButton alloc]init];
    _setBtn.titleLabel.font = kSYSTEMFONT(14);
    [_setBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    [_setBtn setTitle:@"系统时间校准".rh_localized forState:UIControlStateNormal];
    _setBtn.backgroundColor = CMainColorGreen;
    [_setBtn setCornerRadius:8];
    [bgView addSubview:_setBtn];
    CGFloat btnW = [_setBtn.titleLabel.text getStringWidthFont:_setBtn.titleLabel.font limitHeight:30]+30;
    [_setBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_offset(-15);
        make.height.offset(44);
        make.top.mas_offset(10);
        make.bottom.mas_offset(-10);
        make.left.mas_offset(15);
    }];
    
    
    //时间设置
    [[_setBtn rac_signalForControlEvents:UIControlEventTouchUpInside]subscribeNext:^(__kindof UIControl * _Nullable x) {
        if (weakSelf.setAction) {
            weakSelf.setAction();
        }
    }];
    
   
}

@end
